
import axios from 'axios'

const inst = axios.create({
    baseURL: 'http://crm.cimns.com',
})

inst.interceptors.request.use(config => {
    return {...config, headers: {
        authKey: window.sessionStorage.getItem('authkey') || '',
        sessionId: window.sessionStorage.getItem('sessionid') || ''
    }}
})

// export const login = function(){

// }

// username=name&password=pwd

function login(username, password){
    return inst.post('/index.php/admin/base/login', {
        username, password
    })
}

function num(){
    return inst.post('/index.php/oa/message/num')
}

export {
    login,
    num
}
